from flask import Blueprint, current_app, jsonify,request,g
from sqlalchemy import text
import pandas as pd
import base64
from PIL import Image
import io,os
import datetime
from serverFiles import prj_dict

translations = Blueprint('translations', __name__)

data = {
    'zh': prj_dict['Dicts'][20],
    'en': prj_dict['Dicts'][19],
    'ru': prj_dict['Dicts'][4]
    }

@translations.route('/api/translations', methods=['GET'])
def get_translations():
    # print('translations')
    response = jsonify(data)
    return response


def t(lang,src):
    l = data.get(lang)
    if l != None:
        return l.get(src,src)
    else:
        return src